﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace TFSServices.Common
{
    public class TeamProjects : List<TeamProject>
    {
        public TeamProjects()
        {
        }
    }

    [DataContract]
    [KnownType(typeof(BuildType))]
    public class TeamProject
    {
        public TeamProject()
        {
            BuildTypes = new List<BuildType>();
        }

        [DataMember]
        public String Name { get; set; }

        [DataMember]
        public List<BuildType> BuildTypes { get; set; }

        [DataMember]
        public Int32 ActiveItems { get; set; }

        [DataMember]
        public Int32 ResolvedItems { get; set; }

        [DataMember]
        public Int32 ClosedItems { get; set; }
    }

    [DataContract]
    public class BuildType
    {
        public BuildType()
        {
        }

        [DataMember]
        public DateTime LastBuild { get; set; }
        [DataMember]
        public String Name { get; set; }
        [DataMember]
        public String Status { get; set; }
        [DataMember]
        public Int32 NumberOfConsecutiveBuilds { get; set; }
    }
}
